<?php


function server_time(){
	$time = time();
	to_ajax(1, '000', array('timestamp'=>$time, 'year'=>date('Y',$time), 'month'=>date('m',$time), 'day'=>date('d',$time) ));
}



function cart_list(){
	$goods_id = i('goods_id','0');
	$num      = i('num','1');
	print_r($GLOBALS['cart']->cart_list());
}

function cart_add(){
	$goods_id = i('goods_id','0');
	$num      = i('num','1');
	print_r($GLOBALS['cart']->cart_add($goods_id, $num));
}

function cart_del(){
	$goods_id = i('goods_id','0');
	print_r($GLOBALS['cart']->cart_del($goods_id));
}

function cart_empty(){
	print_r($GLOBALS['cart']->cart_empty());
}


function order_save(){
	$desk_id = i('desk_id','0');
	$user_id = i('user_id','0');
	$paytype = i('paytype','0'); //支付类型
	$payuser_num = i('payuser_num','0'); //支付人数
	var_dump($GLOBALS['cart']->order_save($desk_id,$user_id,$paytype,$payuser_num));
}

function order_pay(){
	$order_id = i('order_id','0');
	$user_id = i('user_id','0');
	var_dump($GLOBALS['cart']->order_pay($user_id, $order_id));
}






